<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>回调函数</title>
</head>
<body>

</body>
<script>
    function foo(item,callback) {
        callback(item);
    }

    /*
    * * 1、获取实际参数
    *       1. hello
    *       2. function(item){}
    *    2. 回到foo的定义
    *           function('hello'){}
    *    3. 进入函数执行阶段的callback的函数体中
    * */
    foo("hello",function (item) {
        document.write(item + " " + 'world');
    })

    foo("hello",function (item) {
        document.write(item.length);
    })

</script>
</html>